import request from '@/utils/request'

// es6模块化规范---浏览器环境使用   (nodejs;是服务器环境，commonJS模块化规范exports require)
// 一个js文件只能有二个默认导出（表示可以用任意名称接受  import xxx)
// 可以有多个按需导出(  import {xxxx} from  )

// 获得公司组织结构
export const getDepartmentInfoRequest = () => request.get('/company/department')

// 请求新增子部门数据
export const addDepartmentRequest = data => request.post('/company/department', data)

// 根据部门id查询部门详情
export const getDepartmentByIdRequest = id => request.get(`/company/department/${id}`)

// 根据ID修改部门详情
export const updateDepartmentByIdRequest = data => request.put(`/company/department/${data.id}`, data)

// 根据ID删除
export const delDepartmentByIdRequest = id => request.delete(`/company/department/${id}`)
